]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
authPrompt: Call next button "Unlock" when user switching
authorRay Strode <rstrode@redhat.com>
Mon, 22 Jul 2013 14:59:57 +0000 (10:59 -0400)
committerRay Strode <rstrode@redhat.com>
Thu, 25 Jul 2013 13:28:22 +0000 (09:28 -0400)
When a ShellUserVerifier is asked to verify a user at the login
screen it will transparently first try to reauthenticate the user
against an existing session and then fall back to logging a user
into a new session.  The former is used for user switching.
It's useful to know which type of verification is happening, so
the next button can be made to say "Unlock" instead of "Sign In" when
a user is already signed in.

This commit exports a new "reauthenticating" property on the
ShellUserVerifier that the auth prompt checks when deciding which
label to use for its next button.

https://bugzilla.gnome.org/show_bug.cgi?id=704795

js/gdm/authPrompt.js
js/gdm/util.js

index 2ef92e1bccf6329d8f27274b3bf4f5921080ed9d..318bcfa02d59c4aa94e60c11511e13c8043a3867 100644 (file)
@@ -198,9 +198,9 @@ const AuthPrompt = new Lang.Class({
             this.cancelButton.hide();
 
         if (passwordChar) {
-            if (this._mode == AuthPromptMode.UNLOCK_ONLY)
+            if (this._userVerifier.reauthenticating)
                 this.nextButton.label = _("Unlock");
-            else if (this._mode == AuthPromptMode.UNLOCK_OR_LOG_IN)
+            else
                 this.nextButton.label = C_("button", "Sign In");
         } else {
             this.nextButton.label = _("Next");
index 20540b7e280b19bed9cc7fca16cd34b8ccc78b92..1facf98814b3217e223b4859160f7216b99ec00c 100644 (file)
@@ -121,6 +121,7 @@ const ShellUserVerifier = new Lang.Class({
         this._messageQueue = [];
         this._messageQueueTimeoutId = 0;
         this.hasPendingMessages = false;
+        this.reauthenticating = false;
 
         this._failCounter = 0;
     },
@@ -129,6 +130,7 @@ const ShellUserVerifier = new Lang.Class({
         this._cancellable = new Gio.Cancellable();
         this._hold = hold;
         this._userName = userName;
+        this.reauthenticating = false;
 
         this._checkForFingerprintReader();
 
@@ -267,6 +269,7 @@ const ShellUserVerifier = new Lang.Class({
             return;
         }
 
+        this.reauthenticating = true;
         this._connectSignals();
         this._beginVerification();
         this._hold.release();